﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Student_shzt : System.Web.UI.Page
{
    DataClassesDataContext db = new DataClassesDataContext();
    private string wbh;
    protected void Page_Load(object sender, EventArgs e)
    {
        wbh = Session["wbh"].ToString();
        if ((db.proc_ISOpenDate(3)) < 1)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "<script>alert('该功能暂未开放，请等待！');window.location='../main.aspx'</script>");
            return;
        }
        BindDate();
    }
     private void BindDate()
        {
            wbh = Session["wbh"].ToString();
            var result = (from p in db.proc_GetStuInfoBywbh(wbh)
                          select p).ToList().First();

            switch (result.proflag)
            {
                case 0:
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "<script>alert('请先完成报名！');window.location='../main.aspx'</script>");
                    return;
                case 1:
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "<script>alert('请先提交报名信息！');window.location='../main.aspx'</script>");
                    return;
                case 2:
                    Label21.Text = "请等待院校审核！";
                    break;
                case 4:
                    Label21.Text = "审核未通过！";
                    break;
                default:
                    if (result.zKZflag == 1)
                    {
                        Label21.Text = "<span style='color:#F8A669;'>请根据现场审核时的要求补充相关材料，否则无法下载打印准考证。</span>";
                        break;
                    }
                    else
                    {
                        Label21.Text = "<span style='color:red;'>恭喜您，审核通过！</span>";
                        break;
                    }
            }

            Image2.ImageUrl = "~/Student/stuimage/" + result.sidfy + ".jpg";
            Label3.Text = result.sname;
            Label4.Text = result.ssex;
            Label5.Text = result.snation;
            Label6.Text = result.sps;
            string S = result.sbirth;
            if (S != null)
                Label7.Text = S.Substring(0, 4) + "年" + S.Substring(4, 2) + "月" + S.Substring(6, 2) + "日";
            Label8.Text = result.sidfy;
            Label9.Text = result.gkbmh;
            Label10.Text = result.sdept;
            Label11.Text = result.byzy;
            Label12.Text = result.bkgx;
            Label13.Text = result.proName;
            Label14.Text = result.proNum;
            TextBox1.Text = result.getaward;
            TextBox2.Text = result.advantage;
            Label17.Text = result.haddress;
            Label18.Text = result.sphone;
            Label19.Text = result.lxaddress;
            Label20.Text = result.postcode;
        }
    
}